export default {
	//数据
	data() {
		return {
      total: 0, //总条数
      page: 1, //当前页
      size: 9, //每页显示条数
      search: '',
      searchType: 'expertName',
      expertList: [],
      fatherIndex:0, //一级菜单下标
		}
	},
	created() { //调用方法
		this.searchTodo();
	},
	mounted() {

	},
	updated:function(){
		if(this.getParamValue("fatherIndex")){
			this.fatherIndex=this.getParamValue("fatherIndex");
		}
	},
	methods: { //写函数方法
		//用户下拉信息鼠标事件
		showUl: function() {
			$(".meun>.Experts-box").css("display", "block");
		},
		leaveDiv: function() {
			$(".meun>.Experts-box").css("display", "none");
		},
		//模糊查询合作专家信息
    searchTodo: function(flg) {
			var that = this;
			var data = {};
			if (flg) { //初始化页码
        that.page = 1;
        that.expertList = [];
      }
      data[that.searchType] = that.search;
      data["pageNum"] = that.page;
      data["pageSize"] = that.size;
			that.$post(
				that.urls.findPageExperts,
				data
			).then(function(res) {
				if(res.success) {
          that.total = res.pageInfo.total;
          that.page = res.pageInfo.pageNum;
          let dataList = res.pageInfo.list;
          let expertList = that.expertList;
				  if (expertList != null && expertList.length > 0)
				  {
				    for (var i = 0,len = dataList.length; i < len; i++) {
              expertList.push(dataList[i]);
            }
            that.expertList = expertList;
          } else {
            that.expertList = res.pageInfo.list;
          }
				}
			})
		},
		//加载更多
		loadMoreExperts: function() {
      this.page = this.page + 1;
      this.searchTodo();
		},
		//专家详情
		expertsDetails:function(uuid){
			if (uuid != null && uuid != '') {
        this.set("expertUuid", uuid);
        this.$router.push({
          path: "/ExpertsDetails?fatherIndex="+this.fatherIndex,
        })
      }
		},
	}
}
